from rest_framework import serializers
from .models import Order


class OrderSerializer(serializers.ModelSerializer):
    address = serializers.ListField(label='地址列表', child=serializers.CharField(),read_only=True)

    class Meta:
        model = Order
        fields = ['id', 'name', 'company', 'province_id',
                  'city_id', 'district_id', 'phone', 'order',
                  'special_date', 'remark', 'created_at', 'address',
                  'product_name']
